<template>
  <div class="wx-auth-detail">
    <tn-wx-login
      class="wx-login"
      :appid="appid"
      :scope="scope"
      :redirect-uri="redirect_uri"
      :theme="theme"
      :self-redirect="self_redirect"
    />
  </div>
</template>

<script>
const defaultSettings = require('../../../../settings.js')
import TnWxLogin from '@/components/TNWXLogin'

export default {
  name: 'AdminWxAuthDetail',
  components: { TnWxLogin },
  props: {
    id: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      appid: defaultSettings.wxAuthLoginAPPID,
      scope: 'snsapi_login,snsapi_userinfo',
      redirect_uri: '',
      theme: 'black',
      self_redirect: true
    }
  },
  created() {
    this.redirect_uri = process.env.VUE_APP_BASE_URL +
      `admin.php/admin/add_wx_auth/${this.id}/`

    this.redirect_uri = encodeURI(this.redirect_uri)
  }
}
</script>

<style lang="scss">
</style>
